import torch
from safetensors import safe_open


def convert_last_char_to_uppercase(string):
    if string:
        string = string[:-1] + string[-1].upper()
    return string

model = torch.load("/home/zh/ascend-llm-main/export_llama/model/Qwen2_adapter/adapter_model.bin")  

lora_model = {}
base_mode = {}

for key,value in model.items():
    if 'lora' in key:
        lora_model[key.replace('.default','')] = value
   
torch.save(lora_model, "/home/zh/ascend-llm-main/export_llama/model/Qwen2_adapter/adapter_model.bin")
